package game.dungeon.position;

import be.kuleuven.cs.som.annotate.Value;

/**
 * An enumeration of directions, there are 6 directions defined:
 * north, east, west, south, ceiling and floor.
 * 
 * @version 1.0
 * @author Chris Desomer, Geert Heyman
 */

@Value
public enum Direction {
	NORTH, EAST, WEST, SOUTH, CEILING, FLOOR;
	
	/**
	 * Return the opposite direction of this direction.
	 * 
	 * @return 	  | if (this == NORTH)
	 * 			  | 	then result == SOUTH 
	 * 			  |	if (this == SOUTH)
	 * 			  |		then result == NORTH
	 * 			  | if (this == EAST)
	 * 			  |		then result == WEST
	 * 			  | if (this == WEST)
	 * 			  |		then result == EAST
	 * 			  | if (this == CEILING)
	 * 			  |		then result == FLOOR
	 * 			  | if (this == FLOOR)
	 * 			  |		then result == CEILING
	 */
	public Direction getOppositeDirection (){
		if (this == NORTH)
			return SOUTH;
		if (this == SOUTH)
			return NORTH;
		if (this == EAST)
			return WEST;
		if (this == WEST)
			return EAST;
		if (this == CEILING)
			return FLOOR;
		return CEILING;			 
	}
}
